<html>
<header></header>
<body>
    <img class="img" src="" border="0" usemap="#planetmap" style="display: block; width:100%"/>
    <map name="planetmap" id="planetmap">
        <area class="area" shape="rectangle" coords="" href ="#"/>
    </map>
    <input type="hidden" class="jmpurl" value=""/>
    <script src="https://bdw-public-1259268558.cos.ap-nanjing.myqcloud.com/jquery-3.4.1.min.js"></script>
    <script>
        var lid = parseInt(getQueryString('lid'));
        var mid = parseInt(getQueryString('mid'));
        var goods_sign = getQueryString('goods_sign');
        var clickid = getQueryString('clickid');
        var plan_id = parseInt(getQueryString('adid'));
        var advertiser_id = parseInt(getQueryString('advertiser_id'))
        $.ajax({
            type: "POST",
            dataType: "JSON",
            //请求地址
            url: "https://qianniu.bingdou.site/v1/pdd/site_linear/detail",
            contentType:'application/json;charset=UTF-8',
            data: JSON.stringify({ "lid": lid, "mid":mid, "clickid":clickid, "good_sign":goods_sign,
					"plan_id":plan_id, "advertiser_id":advertiser_id }),
            //数据，json字符串
            //请求成功
            success: function (result) {
                console.log(result)
                $('.img').attr('src', result.data.url)
		//$('.jmpurl').attr('value', result.data.linear)
                $('.area').attr('coords', result.data.click_rect)
            }
        });

        $('.area').click(function () {
	    //var jmpurl = $('.jmpurl').val();
	    //window.location.href=jmpurl;
	    //return;
            console.log(123)
            console.log(clickid)
            $.ajax({
                type: "POST",
                dataType: "JSON",
                //请求地址
		url: "https://qianniu.bingdou.site/v1/pdd/site_linear/detail",
            contentType:'application/json;charset=UTF-8',
            data: JSON.stringify({ "lid": lid, "mid":mid, "clickid":clickid, "good_sign":goods_sign,
                                        "plan_id":plan_id, "advertiser_id":advertiser_id }),
                //数据，json字符串
                //请求成功
                success: function (result) {
                    console.log(result)
                    window.location.href=result.data.linear
                }
            });
        });

        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
        }
    </script>
</body>
</html>